#include "main.h"

#define OS_FREQ 12000000UL    // 系统时钟
#define TIM_CNT_MS 10         // 定时时间 ms 

#define TIMER_RS  (OS_FREQ/1000*TIM_CNT_MS) 
void main() {
    P0 = 0;
    
    // 设置定时器0 
    PXY_WR(TIMER_BASE + 0,(TIMER_RS>>16)&0xff );
    PXY_WR(TIMER_BASE + 1,(TIMER_RS>>8)&0xff);
    PXY_WR(TIMER_BASE + 2,TIMER_RS&0xff); 
    // 使能定时器0
    PXY_WR(TIMER_BASE + 3,0x01);
    IE = 0X80 ; //开启全局中断 

    while(1) {
        if(timeOky){
            Task_Marks_Handler_Callback();
            timeOky = 0 ;
        }
        Task_Pro_Handler_Callback();
    }
}


void task1Cb()
{
    P0=P0+1; 
}

void task2Cb()
{
    // P0=1; 
}
